import JSEncrypt from "@/common/jsencrypt.js"

const PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqR1O6V0zYA6jmd08fb90VB66AYR2uCkImEJ5MmIOalUQykayMwOq5D+UYNVzB3zYZRc0C9vQwuTzYkpZ56iKwRev+RZg+6xN2MKa5ke3mbMHwA6WnB1vUS7P6sQdLw/U+VbK1eFbxLe48L2sz7Fm7K6bmdKNyxuRL00V1aaWPvQIDAQAB-----END PUBLIC KEY-----'

const tmp = null
const ctx = uni.createInnerAudioContext()  // 音乐播放器上下文
const musicList= [] // 临时存储的播放列表
// 重新封装的请求，添加的自定义的header ：userid

//RSA加密
function getRsaCode(str){
	var encrypt = new JSEncrypt();
	encrypt.setPublicKey(this.PUBLIC_KEY);
	var encrypted = encrypt.encrypt(str);
	console.log('加密后数据:%o', encrypted);
	return encrypted;
}

export default{
	tmp,
	ctx,
	PUBLIC_KEY,
	getRsaCode,
	musicList
}